<template>
  <div style="width:100%">
        <div class="box" :style="backStyle">
          <div class="box_top" >
            <span>安徽省人民政府办公厅</span>
            <span>公文限时办理专用章</span>
          </div>
          <div class="box_bottom" :style="backStyleTop" >
            <div>
                请于  
                <span><el-input v-model="input1" class="boxInput" placeholder="" @input="formatValue"></el-input></span>
                年
                <span><el-input v-model="input2" placeholder="" @input="formatValue"></el-input></span>
                月
                <span><el-input v-model="input3" placeholder="" @input="formatValue"></el-input></span>
                日前
                <span class="textC">办理</span>
            </div>
            <div>
              
              <i class="el-icon-arrow-down"></i>
            </div>
          </div>
        </div>
  </div>
</template>
<script>
export default {
  name: 'publicStamp',
  props: {
    value: null,
    mode: {
      default: "edit", // 编辑模式和 edit， 展示模式 view
    },
  
    background: {
      type: String,
      default:'#19c9aa',
    },
    color: {
      type: Array,
      default: '#19c9aa',
    },
   
  },
  computed: {
    isDesigner(){
      return this.$attrs._source === 'designer'
    },
    backStyle() {
      console.log( { borded:`1px solid ${this.background}`,color:this.color},'88888888888888888888888888888888')
      return { border:`2px solid ${this.background}`,color:this.color}
    }, 
    backStyleTop() {
     
      return { 'border-top':`2px solid ${this.background}`}
    }, 
    computedValue: {
      get() {
        const tem = this.input1 +',' + this.input2 + ',' + this.input3
        console.log(tem)
        return tem
      },
      set(val) {
        const arr = val &&val.split(',') || ['', '', '']
        this.input1 = arr[0]
        this.input2 = arr[1]
        this.input3 = arr[2]
        this.$emit('input', val)
      }
    }

   
  },
  data() {
    return {
      input1:'',
      input2:'',
      input3:'',
    }
  },
  created(){
  },
  watch: {
    value: {
      immediate: true,
      handler(val) {
        console.log(val,'====watch')
        this.computedValue = val
      }
    }
  },
  methods: {
    formatValue(item) {
      alert(item)
      const tem = this.input1 +',' + this.input2 + ',' + this.input3
        console.log(tem)
        this.$emit('input', tem)
    }
  }
}
</script>
<style lang="scss" scoped>
.box{
  padding: 2px 0;
  width: 350px;
  
  border: 1px solid red;
  display: flex;
  flex-direction: column;
  .box_top{
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
  }
  .box_bottom{
    border-top: 1px solid red;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 10px;
    font-weight: 700;
    .textC{
      font-size: 12px;
    }
  }
}
::v-deep .el-input{
  width: 30px;
}
.boxInput{
  width: 40px;
}
::v-deep .el-input__inner{
  padding: 0px;
}
</style>